# Tutorial case
@@
from anims import *
from bgs import *
from macros import *

def cycle_colors(s):
    i = 1
    r = ''
    for c in s:
	r += '<color:%d>%s' % (i,c)
	i = (i+1)%3
    return r+'<color:0>'

def testbgs():
    s = ''
    for i in range(28,32):
	s += set_bg(i)+person_anim(MAYA_SAD_T,MAYA_SAD)
	s += 'Displaying background <color:1>%d<color:0> !<p>' % i
    return s
@@
[0]<noop>
<person:0,0,0><name:0><hidetextbox:0><74><p><noop><wait:30><speed:10>
<30:2><5D:1><color:3>Script editing Tutorial<b>
by @cycle_colors('deufeufeu')@<p><5D:0><color:0><wait:30><speed:255>
<hidetextbox:1>
@set_bg(BG_PHOENIX_OFFICE)@

<hidetextbox:0>

@set_name('Maya')@
@person_anim(MAYA_DECIDED_T,MAYA_DECIDED)@
Hi all !!!<shake:30,1><b>
Welcome to this simple tutorial !<p>

@person_anim(MAYA_DECIDED_T,MAYA_DECIDED)@
To change the displayed person<b> you call : <b>
<color:1>person_anim(anim1,anim2)<color:0><p>

It will jump from anim1 to anim2<b> at the end of the sentence.<p>

@person_anim(MAYA_SMART_T,MAYA_SMART)@
Now I will show you a powerfull<b>
<color:1>Python macro !<color:0> It will<b>
allow us to cycle trough bgs.<p>

@person_anim_static(MAYA_SHOCKED)@
<color:2>Beware !<color:0> Invalid backgrounds<b>
will crash the game !<p>
@testbgs()@

@set_bg(30,True)@
@person_anim(MAYA_SMART_T,MAYA_SMART)@
You can pass True to set_bg in<b>
order to shift some bgs right.<b>
example : <color:1>set_bg(30,True)<color:0><p>

@person_anim(MAYA_TEARS_T,MAYA_TEARS)@
Now I'll leave you. To end the <b>
episode part just call <colors:1>end_part()<colors:0><b>
See you soon !<p>

@end_part()@

